package cn.zjgem.real.report.controller;

import cn.zjgem.real.report.apis.PublishControllerApi;
import cn.zjgem.real.report.dto.PageRequestDto;
import cn.zjgem.real.report.dto.PublishDto;
import cn.zjgem.real.report.dto.ResponseResult;
import cn.zjgem.real.report.service.PublishService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/report")
public class PublishController implements PublishControllerApi {
    @Autowired
    private PublishService publishService;

    /**
     * PublishDto 接收上报信息
     * @return
     */
    @PostMapping("/savePublish")
    public ResponseResult savePublish(PublishDto dto) {

        return this.publishService.savePublish(dto);
        }

    /**
     *
     * @param dto 分页查询我的报灾
     * @return
     */
    @PostMapping("/publishList")
    public ResponseResult publishListById(PageRequestDto dto){
    return this.publishService.publishListById(dto);
    }
}

